package com.xls.commonlibrary.util;

import com.tencent.mmkv.MMKV;

public class MMKVUtil {
    private static volatile MMKVUtil singleton = null;

    private MMKV kv = null;

    public MMKV getKV() {
        // 统一用这个
        return kv;
    }

    private MMKVUtil() {
        kv = MMKV.mmkvWithID("InterProcessKV", MMKV.MULTI_PROCESS_MODE);
    }

    public static MMKVUtil getInstance() {
        if (singleton == null) {
            synchronized (MMKVUtil.class) {
                if (singleton == null) {
                    singleton = new MMKVUtil();
                }
            }
        }
        return singleton;
    }


    // null 问题   给个 ""
//      return MMKVUtil.getInstance().getKV().decodeString(key,"");

}
